package server.core;

/**
 * The ProblemMessage class bundles up all of the data extracted from a problem
 * solution request message sent by a client.
 * 
 * @author Clayton Edward Taylor
 */
public class ProblemMessage {

	private String type;
	private long timeOut;
	private String data;
	
	/**
	 * Creates a new ProblemMessage object with the specified type, timeout,
	 * and data.
	 * 
	 * @param type    - The name of the problem type
	 * @param timeOut - The maximum amount of time the client is willing to 
	 *                  wait for a solution
	 * @param data    - The unparsed data of the problem
	 * @see             ProblemMessage
	 */
	public ProblemMessage(String type, long timeOut, String data) {
		
		this.type = type;
		this.timeOut = timeOut;
		this.data = data;
	}
	
	/**
	 * Gets the problem type for this ProblemMessage.
	 * 
	 * @return The type of the problem
	 * @see    ProblemMessage
	 */
	public String getType() {
		
		return type;
	}
	
	/**
	 * Gets the maximum time to wait for this ProblemMessage.
	 * 
	 * @return The maximum time to wait for a solution
	 * @see    ProblemMessage
	 */
	public long getTimeOut() {
		
		return timeOut;
	}
	
	/**
	 * Gets the problem data for this ProblemMessage.
	 * 
	 * @return The data of the problem
	 * @see    ProblemMessage
	 */
	public String getData() {
		
		return data;
	}
	
	/**
	 * Changes the maximum time to wait for this ProblemMessage to the new 
	 * value specified.
	 * 
	 * @param timeOut - The new maximum time to wait for a solution
	 * @see             ProblemMessage
	 */
	public void setTimeOut(long timeOut) {
		
		this.timeOut = timeOut;
	}
}
